package com.deam.imsdk.utils;

import android.content.Context;

import com.deam.imsdk.bean.APPUserData;
import com.deam.imsdk.bean.UserInfo;

/**
 * Created by Administrator on 2018/3/19.
 */

public class UserUtil {
    private String TAG = getClass().getName();
    private static APPUserData<UserInfo> appUser;


    public static void registerUserUtil(Context context) {
        appUser = new APPUserData<>(context);
    }

    public static UserInfo getUser() {
        return appUser.getModel(new UserInfo());
    }

    public static void commitUser(UserInfo User) {
        appUser.doSave(User);
    }

    public static void clearCache() {
        commitUser(new UserInfo());
    }

    public static APPUserData<UserInfo> getAppUser() {
        return appUser;
    }
}
